<template>
	<view>
    <uni-easyinput class="uni-mt-5" trim="all" v-model="dispose.value" :placeholder="dispose.placeholder" ></uni-easyinput>

    <button style="margin-top: 20rpx" type="primary" @click="back">确定</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
        dispose:{
          placeholder:"请输入内容",
          value:"",
          title:"更改名字",
          paramName:"",
        }
			}
		},
    onLoad(option) {
      this.dispose = JSON.parse(decodeURIComponent(option.dispose));
      uni.setNavigationBarTitle({
        title: this.dispose.title
      });
    },

    methods: {
			back(){
        let pages = getCurrentPages();  //获取所有页面栈实例列表
        let nowPage = pages[ pages.length - 1];  //当前页页面实例
        let prevPage = pages[ pages.length - 2 ];  //上一页页面实例
        let paramNames=this.dispose.paramName.split(".")
        prevPage.$vm[paramNames[0]][paramNames[1]] = this.dispose.value;   //修改上一页data里面的sh参数值为100
        uni.navigateBack({  //uni.navigateTo跳转的返回，默认1为返回上一级
          delta: 1
        });
      }
		}
	}
</script>

<style>

</style>
